<!--{json width:"550",title:"删除操作"}-->

<form action="?mod-delete-fid-$fid-fid_tids-$fid_tids-ajax-1.htm" method="post" id="mod_delete_form">
	<input type="hidden" name="FORM_HASH" value="{FORM_HASH}" />
	<dl>
		<dt><label>主题：</label></dt>
		<dd>$threads (篇)</dd>
		
		<dt><label for="delete_comment">版主备注：</label></dt>
		<dd>
			<textarea name="comment" id="delete_comment" style="width: 350px; height: 40px;" onkeyup="if(this.value.length > 64) {alert('最多只能输入64个字符。'); return false;}">$modlog[comment]</textarea>
		</dd>
		
		<dt><label>通知作者：</label></dt>
		<dd><input type="checkbox" name="systempm" value="1" /></dd>
		
		<dt>&nbsp;</dt>
		<dd>
			<input type="submit" class="button bigblue" id="mod_delete_submit" value="确定删除" />
			<input type="button" class="button biggrey" value="关闭" id="mod_delete_cancel"/>
		</dd>
	</dl>
</form>

<script type="text/javascript">
// 延迟执行的脚本，约定名字为：delay_execute()
function delay_execute(dialog, recall) {
	$('#mod_delete_submit').focus();
	$('#mod_delete_submit').click(function() {
		$('#mod_delete_submit').disable();
		var postdata = $("#mod_delete_form").serialize();
		$.post($('#mod_delete_form').attr('action'), postdata,  function(s){
			$('#mod_delete_submit').enable();
			var json = json_decode(s);
			if(error = json_error(json)) {alert(error); return false;}
			
			dialog.set_body('<div class="ok">'+json.message+'！</div>');
			setTimeout(function(){
 				dialog.close();
	 			if(recall) recall();
	 		}, 1000);
		  });
		return false;
	});
	
	$('#mod_delete_cancel').click(function() {
		dialog.close(true);
	});
}
</script>
